<?php
namespace backend\modules\admin\models;

use yii\db\ActiveRecord;

class RolePriv extends ActiveRecord
{

    /**
     * Role_priv类关联数据库表名称 
     */
    public static function tableName()
    {
        return '{{%admin_role_priv}}';
    }

    /**
     * 检查该角色是否有访问页面的权限
     */
    public static function checkpriv($roleid,$m,$c,$a,$siteid)
    {
        $e = self::find()->where(array('roleid'=>$roleid,'m'=>$m,'c'=>$c,'a'=>$a,'siteid'=>$siteid))->exists();
        if($e)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    


}





?>